//
//  s_and_r.c
//  c_pr
//
//  Created by chenyh on 2021/1/18.
//

#include <stdio.h>
#include <time.h>
static unsigned long int next = 1; //种子

int rand1(void)
{
    //生成伪随机数的魔术公式
    next = next * 1103515245 + 123456;
    return (unsigned int) (next / 65536) % 32768;
}

void srand1(unsigned int seed)
{
    next = seed;
}
